#include<bits/stdc++.h>
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define debug  freopen("in.txt","r",stdin),freopen("out.txt","w",stdout);
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn = 1e6+10;
using namespace std;

int N;
int cnt[4];
double dp[333][333][333];
double dfs(int a,int b,int c){
    if(a + b + c == 0) return 0.0;
    if(dp[a][b][c] > -0.5) return dp[a][b][c];
    double res = double(N)/(a+b+c);
    if(a) res += dfs(a-1,b,c) * a/(a+b+c);
    if(b) res += dfs(a+1,b-1,c) * b/(a+b+c);
    if(c) res += dfs(a,b+1,c-1) * c/(a+b+c);
    return dp[a][b][c] = res;
}
int main(){
    // debug;
    ios;

    cin>>N;
    for(int i = 1;i<=N;i++){
        int x;cin>>x;
        ++cnt[x];
    }
    for(int i = 0;i<=N;i++)
        for(int j = 0;j<=N;j++)
            for(int k = 0;k<=N;k++)
                dp[i][j][k] = -1;
    cout.precision(12);
    cout<<dfs(cnt[1],cnt[2],cnt[3])<<'\n';

    
    return 0;
}
